package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.cnswhy.cloud.common.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 商户基本信息
 * </p>
 *
 * @author cnswhy
 * @since 2021-07-01
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_merch")
@ApiModel(value = "Merch", description = "商户基本信息")
@AllArgsConstructor
public class Merch extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 用户编号
     */
    @ApiModelProperty(value = "用户编号")
    @TableField("customer_id")
    @Excel(name = "")
    private Long customerId;

    /**
     * 商家状态1正常2待审核3审核不通过4禁用5删除6草稿
     */
    @ApiModelProperty(value = "商家状态1正常2待审核3审核不通过4禁用5删除6草稿")
    @NotNull(message = "商家状态1正常2待审核3审核不通过4禁用5删除6草稿不能为空")
    @TableField("status")
    @Excel(name = "")
    private Integer status;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "address", condition = LIKE)
    @Excel(name = "地址")
    private String address;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "province", condition = LIKE)
    @Excel(name = "省份")
    private String province;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "city", condition = LIKE)
    @Excel(name = "城市")
    private String city;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "name", condition = LIKE)
    @Excel(name = "商家名称")
    private String name;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "area", condition = LIKE)
    @Excel(name = "区域")
    private String area;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "lat", condition = LIKE)
    @Excel(name = "")
    private String lat;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "lng", condition = LIKE)
    @Excel(name = "")
    private String lng;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "category", condition = LIKE)
    @Excel(name = "")
    private String category;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "tel", condition = LIKE)
    @Excel(name = "电话")
    private String tel;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "type", condition = LIKE)
    @Excel(name = "分类")
    private String type;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "typecode", condition = LIKE)
    @Excel(name = "")
    private String typecode;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "pcode", condition = LIKE)
    @Excel(name = "")
    private String pcode;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "citycode", condition = LIKE)
    @Excel(name = "")
    private String citycode;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "adcode", condition = LIKE)
    @Excel(name = "")
    private String adcode;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "search_key", condition = LIKE)
    @Excel(name = "搜索关键字")
    private String searchKey;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "serarch_area", condition = LIKE)
    @Excel(name = "搜索区域")
    private String serarchArea;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "search_radius", condition = LIKE)
    @Excel(name = "")
    private String searchRadius;
    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "search_type", condition = LIKE)
    @Excel(name = "")
    private String searchType;
    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "sett_date", condition = LIKE)
    @Excel(name = "查询日期")
    private String settDate;

    @ApiModelProperty(value = "")
    @TableField("search_id")
    @Excel(name = "")
    private Long searchId;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "phone", condition = LIKE)
    @Excel(name = "手机号")
    private String phone;


    @Builder
    public Merch(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long createUser, Long updateUser, 
                    Long customerId, Integer status, String address, String province, String city, 
                    String name, String area, String lat, String lng, String category, String tel, 
                    String type, String typecode, String pcode, String citycode, String adcode, String searchKey, 
                    String serarchArea, String searchRadius, String searchType, String settDate, Long searchId, String phone) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.createUser = createUser;
        this.updateUser = updateUser;
        this.customerId = customerId;
        this.status = status;
        this.address = address;
        this.province = province;
        this.city = city;
        this.name = name;
        this.area = area;
        this.lat = lat;
        this.lng = lng;
        this.category = category;
        this.tel = tel;
        this.type = type;
        this.typecode = typecode;
        this.pcode = pcode;
        this.citycode = citycode;
        this.adcode = adcode;
        this.searchKey = searchKey;
        this.serarchArea = serarchArea;
        this.searchRadius = searchRadius;
        this.searchType = searchType;
        this.settDate = settDate;
        this.searchId = searchId;
        this.phone = phone;
    }

}
